{% extends "Display3D.htm" %}

{% block toolbar %} {% endblock %}
{% block leftcolumn %} {% endblock %}

{% block scripts %} 
    {% if javascript_arborescense or stl %}

        <script type="text/javascript" src="{{STATIC_URL}}js/screenfull.min.js"></script>
        <script type="text/javascript" src="{{STATIC_URL}}js/3D/three-min.js"></script> 
        <script type="text/javascript" src="{{STATIC_URL}}js/3D/struct.js"></script> 
        <script type="text/javascript" src="{{STATIC_URL}}js/jquery.showLoading.min.js"></script>
        <script type="text/javascript">
            THREE.Vertex = function ( position ) { return position; };
        </script>
        {%  if javascript_arborescense %}
            <script type="text/javascript"> 
                function build_tree () {
                    $.globalEval("{{javascript_arborescense|escapejs}}");
                } 
            </script>
        {% endif %}
        <script type="text/javascript" src="{{STATIC_URL}}js/3D/view.js"></script> 
        <script type="text/javascript">
            $( function () {
                {% if stl %}
                    view = new View3D(false, '/file/public/{{stl_file.id}}/');
                {% else %}
                    view = new View3D(true, null, ["/3D/public/{{obj.id}}"]);
                {% endif %}
                view.render();
            });
        </script>
    {% endif %}
{% endblock %}
